/*
 * TaskThreadPool.cpp
 *
 *  Created on: 15.12.2012
 *      Author: zheka
 */

#include "TaskThreadPool.hpp"
#include "io/TaskThread.hpp"
#include <cstdlib>
TaskThreadPool::TaskThreadPool(int count): threads(count) {
	for(int i = 0 ; i <count;i++) {
		threads[i] = new TaskThread();
		threads[i]->start();
	}
}

TaskThread * TaskThreadPool::getTaskThread() {
	return threads[rand() % threads.size()];
}
